//这里封装的所有接口
//引入封装好axios模块
import http from './index'
import qs from 'qs'


//这里封装了大量的接口

//轮播图
export const getbanner = () => http.get('/getbanner')

//首页快速分类导航
export const getcate = () => http.get('/getcate')

// 全部分类
export const gethortgoods = () => http.get('/gethortgoods')

// 商品详情
export const detail = (params) => http.get('/getgoodsinfo', {
    params
})

// 获取分类信息
export const getcates = () => http.get('/getcates')

// 获取分类的商品
export const getgoodlist = (params) => http.get('/getgoodlist', {
    params
})

// 搜索
export const search = (params) => http.get('/search', {
    params
})

// 注册
export const register = data => http.post('/register', qs.stringify(data))

// 登录
export const login = data => http.post('/login', qs.stringify(data))


// 购物车列表
export const cartlist = (params) => http.get('/cartlist', {
    params
})

// 购物车添加
export const cartadd = (data) => http.post('/cartadd', qs.stringify(data))

// 购物车删除
export const cartdelete = data => http.post('/cartdelete', qs.stringify(data))